package com.log.james.service;

import com.log.james.entity.DestIp;
import com.log.james.entity.Fwlog;
import com.log.james.mapper.FwlogDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class FwlogService implements FwlogDao,Serializable{
    @Autowired
    private FwlogDao fwlogDao;

    @Override
    public List<DestIp> getAccessedIp() {
        List<DestIp> topDestIp = fwlogDao.getAccessedIp();
        return topDestIp;
    }

    @Override
    public List<Fwlog> findFwlogsByTime(Date st, Date et) {
        List<Fwlog> fwlogs = fwlogDao.findFwlogsByTime(st,et);
        return fwlogs;
    }

    @Override
    public List<Map<String, Object>> findFwlogByTimeAndSrcIP(Date time, long srcip) {
        List<Map<String,Object>> lists = fwlogDao.findFwlogByTimeAndSrcIP(time,srcip);
        return lists;
    }

    @Override
    public List<Map<String, Object>> findFwlogByTimeAndDestPort(Date time, int destport) {
        List<Map<String,Object>> lists = fwlogDao.findFwlogByTimeAndDestPort(time,destport);
        return lists;
    }

    @Override
    public List<Map<String, Object>> findFwlogByTimeAndDestIP(Date time, long destip) {
        List<Map<String,Object>> lists = fwlogDao.findFwlogByTimeAndDestIP(time,destip);
        return lists;
    }

    @Override
    public List<Map<String, Object>> findCityNumByTime(Date st, Date et) {
        List<Map<String,Object>> lists = fwlogDao.findCityNumByTime(st, et);
        return lists;
    }

    @Override
    public List<Map<String, Object>> findProtocolByTime(Date st, Date et) {
        List<Map<String,Object>> lists = fwlogDao.findProtocolByTime(st, et);
        return lists;
    }
}
